<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div>

    </div>
</body>
</html>

<style>
    div {
        width: 100px;
        height: 100px;
        background: green;
        transition: 1s;
        /* 兼容写法 */
       -webkit-transition: 1s; /*chrome,safari*/
      	-moz-transition: 1s; /*兼容firefox*/
      	-o-transition: 1s; /*兼容opera浏览器*/
    }
    /* 时div hover时元素变大,同时添加过渡动画*/
    div:hover {
        width: 200px;
        height: 200px;
    }

</style>